import { Redirect } from "react-router-dom";
import React from 'react'

// import Discover from "../pages/discover";
// import Leaderboard from "../pages/discover/pages/leaderboard";
// import Recommend from "../pages/discover/pages/recommend";
// import Songs from "../pages/discover/pages/songs";
// import Djradio from "../pages/discover/pages/djradio";
// import Artist from "../pages/discover/pages/artist";
// import Album from "../pages/discover/pages/album";
// import Download from "../pages/download";
// import Frend from "../pages/frend";
// import Mall from "../pages/mall";
// import Mine from "../pages/mine";
// import Musician from "../pages/musician";

const Discover = React.lazy(_ => import("../pages/discover"));
const Leaderboard = React.lazy(_ => import("../pages/discover/pages/leaderboard"));
const Recommend = React.lazy(_ => import("../pages/discover/pages/recommend"));
const Songs = React.lazy(_ => import("../pages/discover/pages/songs"));
const Djradio = React.lazy(_ => import("../pages/discover/pages/djradio"));
const Artist = React.lazy(_ => import("../pages/discover/pages/artist"));
const Album = React.lazy(_ => import("../pages/discover/pages/album"));
const Playlist = React.lazy(_ => import("../pages/discover/pages/playlist"));

const Download = React.lazy(_ => import("../pages/download"));
const Frend = React.lazy(_ => import("../pages/frend"));
const Mall = React.lazy(_ => import("../pages/mall"));
const Mine = React.lazy(_ => import("../pages/mine"));
const Musician = React.lazy(_ => import("../pages/musician"));


const routes = [
    {
        path: "/",
        exact: true,
        render: () => (
            <Redirect to="/discover" />
        )
    },
    {
        path: "/discover",
        component: Discover,
        routes: [
            {
                path: "/discover",
                exact: true,
                render: () => (
                    <Redirect to="/discover/recommend" />
                )
            },
            {
                path: "/discover/recommend",
                component: Recommend
            },
            {
                path: "/discover/leaderboard",
                component: Leaderboard
            },
            {
                path: "/discover/songs/:cat?",
                component: Songs
            },
            {
                path: "/discover/djradio",
                component: Djradio
            },
            {
                path: "/discover/artist",
                component: Artist
            },
            {
                path: "/discover/album",
                component: Album
            },
            {
                path: "/discover/playlist/:id",
                component: Playlist
            }
            
        ]
    },
    {
        path: "/mine",
        component: Mine,
    },
    {
        path: "/frend",
        component: Frend,
    },
    {
        path: "/mall",
        component: Mall,
    },
    {
        path: "/musician",
        component: Musician,
    },
    {
        path: "/download",
        component: Download,
    },
]

export default routes;